<div id="navbar-inner" class="navbar-inner header">
	<span class="span-leave">PERSONAL LEAVING REQUEST</span>
</div>

<!-- Only required for left/right tabs -->
<ul class="nav nav-tabs">
	<?php
	if ($this->uri->segment(3) === "own_pending" OR !$this->uri->segment(3)) {
		?>
		<li class="active"><?php echo anchor('info/show_info/own_pending', 'Pending [<span class="note_num">' . $this->session->userdata('num_own_pending') . '</span>]'); ?></li>
		<li><?php echo anchor('info/show_info/own_approved', 'Approved'); ?></li>
		<?php
	} else if ($this->uri->segment(3) === "own_approved") {
		?>
		<li><?php echo anchor('info/show_info/own_pending', 'Pending [<span class="note_num">' . $this->session->userdata('num_own_pending') . '</span>]'); ?></li>
		<li class="active"><?php echo anchor('info/show_info/own_approved', 'Approved'); ?></li>
		<?php
	}
	?>
</ul>

<div class="row-fluid">
	<?php
	if ($this->session->userdata('change_status_success')) {
		echo $this->session->userdata('change_status_success');
		$this->session->unset_userdata('change_status_success');
	} else if ($this->session->userdata('edit_success')) {
		echo $this->session->userdata('edit_success');
		$this->session->unset_userdata('edit_success');
	} else if ($this->session->userdata('send_success')) {
		echo $this->session->userdata('send_success');
		$this->session->unset_userdata('send_success');
	} else if ($this->session->userdata('delete_success')) {
		echo $this->session->userdata('delete_success');
		$this->session->unset_userdata('delete_success');
	}
	
	if ($this->session->userdata('admin')) {
		if ($this->uri->segment(3) === "own_pending" OR !$this->uri->segment(3)) {
			$this->load->view("info/own_pending");
		} else {
			$this->load->view("info/own_approved");
		}
	} else {
		redirect('main/');
	}
	?>
</div>